This assignment is for ETC5521 Assignment 1 by Team Lorikeet comprising of Aryan Jain and Emily Sheehan.
Measles is a highly infectious disease caused by the Measles virus. It can lead to pneumonia, infections of the middle ear, swelling of the brain and death.
A vaccine exists to prevent the onset of measles as there is no treatment. The vaccine involves the injection of attenuated measles antigens that stimulate the production of antibodies and memory cells, providing long-term protection against the virus. When administered properly, the vaccine is 90.5% effective within 72 hours of exposure (Barrabeig et al., 2011).
Unfortunately there is a growing number of individuals refusing vaccination, particularly in the US (Phadke et al., 2016). In Texas, the number of unvaccinated children attaining exemptions to attend school has increased by 28 times since 2003 (Sinclair et al., 2019). This has led to several outbreaks of vaccine preventable diseases, such as Measles. If this trend continues, there could be calamitous consequences.
This paper hopes to determine whether there is a relationship between socioeconomic status and vaccination rate. Specifically, it explores whether MMR vaccination rates are higher in private schools, how the MMR vaccination rate compares to the overall vaccination rate and compares the average per capita income across the states with the highest and lowest vaccination rates.
To analyse the relationship a dataset was retrieved from Wall Street Journal. Although every precaution has been taken to ensure accurate figures have been calculated, some of the MMR rates, overall vaccination rates and school types were missing from the original dataset. The missing data was identified using vis_miss in the naniar package, and removed to reduce the impact on the figures calculated.
The data comprises of vaccination rates for 46,412 schools in 32 U.S states and was retrieved from The Wall Street Journal. The variables include; the school academic year, the school’s state, city, county, district, name, type, enrollment, MMR (measles, mumps and rubella) vaccination rate, overall vaccination rate, latitude, longitude and the percentage of students exempted from vaccinations due to personal, religious or medical reasons.
The data was collected in the 2017-18 school year for 11 states and 2018-19 school year for the remaining 21 states. The state health departments provided the vaccination data and the National Center for Education Statistic’s provided the school location, which was matched against the school name. In the case that there was no match, the school’s location was found with Google Maps API.
The individual state dataset was scraped from the Tidy Tuesday Github repository and combined with the existing measles dataset with left_join to extract the longitude and latitude variables from it. Various functions from the rvest package were used to scrape the data including read_html and html_table.
Primary Question: Does Measles vaccination rate improve with better socioeconomic conditions?
Secondary Questions:
The measles data was filtered to remove missing school type, overall vaccination rate and MMR rate. It was grouped by type of school and the average MMR vaccination rate and overall vaccination rate was calculated using the mean function. The tibble generated was named school_type_average. Then, the average MMR rates from the school_type_average tibble were plotted. The rates were annotated accordingly, to draw attention to the difference between the MMR vaccination rate for each school type.
The overall vaccination rate and the MMR vaccination rate was the highest in public schools, as seen in the pie chart above. This is consistent with findings from a study conducted by Shaw (2014) where it was found that private schools have higher rates of exemptions for immunisations than public schools.
The school_type_average data was tabulated to compare the overall vaccination rate and MMR vaccination rate. Then, both rates were plotted according to school type.
| Type | Average MMR Vaccination Rate | Average Overall Vaccination Rate |
|---|---|---|
| Kindergarten | 94.2% | 88.0% |
| Private | 93.2% | 91.4% |
| Public | 95.9% | 94.5% |
When comparing the vaccination rates according to school type, it is clear that the overall vaccination rate is lower than the MMR vaccination rate for all school types as seen in the plot below. Public schools have the highest overall vaccination rate and MMR rate.
The measles data was grouped by state and then the average MMR and overall vaccination rate were calculated. Then, the map_data function was used to create a tibble containing the geographical information of each state. This data was merged with the measles_states data, which contains the average MMR and overall vaccination rate for each state. Any missing data or negative values were removed and the remaining data was plotted onto a map and bar chart using geom_polygon and geom_col, respectively. The ggplotly function was used to make the maps interactive.
The state with the highest MMR vaccination rate is Illinois at 97.39% and the state with the lowest MMR vaccination rate is Massachusetts at 57.68% as shown in the figure below.
The Overall and MMR Vaccination Rate, according to State
The state with the highest overall vaccination rate is North Caroline at 96.779%, while the state with the lowest vaccination rate is Washington at 75.238% as shown in the figure above. It is difficult to compare the individual states MMR vaccination rate with the overall vaccination rate due to the missing data. However, California, Vermont, Ohio and Oregon have similar MMR and overall vaccination rates.
To analyse the average income of the states with the highest and lowest vaccination rate, an external dataset from Tax Foundation was retrieved (add link!!). This data was merged with the measles data grouped by state, and the top and bottom five observations were tabulated for both the vaccination rates. The vaccination rate and income data were plotted using geom_col and gg_arrange, and ordered in descending order.
| State | MMR | PCI |
|---|---|---|
| Illinois | 97.39% | $56,839 |
| Pennsylvania | 96.89% | $56,225 |
| Utah | 95.04% | $46,320 |
| Colorado | 94.09% | $58,456 |
| New York | 93.45% | $68,668 |
| State | MMR | PCI |
|---|---|---|
| Massachusetts | 57.68% | $71,683 |
| Connecticut | 71.44% | $76,456 |
| Arizona | 74.56% | $44,329 |
| Montana | 76.20% | $47,538 |
| Washington | 79.45% | $62,026 |
The states with the highest MMR vaccination rate were; Illinois, Pennsylvania, Utah, Colorado and New York. These states each have an average per capita income of $56,839, $56,225, $46,320, $58,456 and $68,668, respectively, as shown in the plot below.
The MMR Vaccination Rate and PCI of each State
The states with the lowest MMR vaccination rate were Massachusetts, Connecticut, Arizona, Montana and Washington. Interestingly enough, Massachusetts and Connecticut report two of the highest average per capita incomes as seen in the figure above.
| State | Overall | PCI |
|---|---|---|
| North Carolina | 96.779% | $46,117 |
| Tennessee | 95.023% | $46,900 |
| Florida | 92.487% | $50,070 |
| Michigan | 91.809% | $48,423 |
| Oregon | 90.265% | $50,843 |
| State | Overall | PCI |
|---|---|---|
| Washington | 75.238% | $62,026 |
| Oklahoma | 76.858% | $46,233 |
| Idaho | 81.036% | $43,901 |
| Iowa | 81.275% | $50,124 |
| Ohio | 82.113% | $48,739 |
The states with the highest overall vaccination rate were North Carolina, Tennessee, Florida, Michigan and Oregon. They had an average per capita income that ranged from $46,117 to $50,843, which is quite low when compared to the other incomes in the plot. The states with the lowest overall vaccination rate were Washington, Oklahoma, Idaho, Iowa and Ohio. Idaho had the lowest per capita income, however, Washington had one of the highest per capita income’s at $62,026, as seen in the figure below.
The Overall Vaccination Rate and PCI of each State
The analysis has revealed that it is likely that there is no association with socioeconomic status and vaccination rates. Private schools, which are more expensive than public schools thus inferring greater socioeconomic status, have a lower average MMR and average overall vaccination rate than their public counterparts. The two states with the lowest MMR vaccination rate; Connecticut and Massachusetts, had the two highest average per capita incomes. Similarly, Washington had the lowest overall vaccination rate and one of the highest average per capita incomes. Therefore, it is unlikely that vaccination rate improves with socioeconomic status.
Add data and software and order in alphabetical - 2 datasets - tax foundation, measles -tidy tuesday https://github.com/TaxFoundation/facts-and-figures
Alboukadel Kassambara (2020). ggpubr: ‘ggplot2’ Based Publication Ready Plots. R package version 0.4.0. https://CRAN.R-project.org/package=ggpubr
Barrabeig, I., Rovira, A., Rius, C., Muñoz, P., Soldevila, N., Batalla, J., & Domínguez, A. (2011). Effectiveness of measles vaccination for control of exposed children. The Pediatric Infectious Disease Journal, 30(1), 78–80.
C. Sievert. Interactive Web-Based Data Visualization with R, plotly, and shiny. Chapman and Hall/CRC Florida, 2020.
Cockcroft, A., Usman, M. U., Nyamucherera, O. F., Emori, H., Duke, B., Umar, N. A., & Andersson, N. (2014). Why children are not vaccinated against measles: a cross-sectional study in two Nigerian States. Archives of Public Health = Archives Belges de Sante Publique, 72(1), 48.
Commonwealth of Australia. (2020, May 27). Measles. Retrieved 25 August 2020, from https://www.health.gov.au/health-topics/measles#what-is-measles
Hadley Wickham and Dana Seidel (2020). scales: Scale Functions for Visualization. R package version 1.1.1. https://CRAN.R-project.org/package=scales
H. Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2016.
Hao Zhu (2019). kableExtra: Construct Complex Table with ‘kable’ and Pipe Syntax. R package version 1.1.0. https://CRAN.R-project.org/package=kableExtra
Kamil Slowikowski (2020). ggrepel: Automatically Position Non-Overlapping Text Labels with ‘ggplot2’. R package version 0.8.2. https://CRAN.R-project.org/package=ggrepel
Nicholas Tierney, Di Cook, Miles McBain and Colin Fay (2020). naniar: Data Structures, Summaries, and Visualisations for Missing Data. R package version 0.5.2. https://CRAN.R-project.org/package=naniar
Original S code by Richard A. Becker, Allan R. Wilks. R version by Ray Brownrigg. Enhancements by Thomas P Minka and Alex Deckmyn. (2018). maps: Draw Geographical Maps. R package version 3.3.0. https://CRAN.R-project.org/package=maps
Pebesma, E., 2018. Simple Features for R: Standardized Support for Spatial Vector Data. The R Journal 10 (1), 439-446, https://doi.org/10.32614/RJ-2018-009
Phadke, V. K., Bednarczyk, R. A., Salmon, D. A., & Omer, S. B. (2016). Association Between Vaccine Refusal and Vaccine-Preventable Diseases in the United States: A Review of Measles and Pertussis. JAMA: The Journal of the American Medical Association, 315(11), 1149–1158.
Queensland Health. (2019, October 22). What is measles and why do we vaccinate against it? Retrieved 25 August 2020, from https://www.health.qld.gov.au/news-events/news/what-is-measles-why-vaccinate#:~:text=The%20 easles%20vaccine%20contains%20a,is%20better%20prepared%20to%20respond
R Core Team (2020). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL https://www.R-project.org/.
Sinclair, D. R., Grefenstette, J. J., Krauland, M. G., Galloway, D. D., Frankeny, R. J., Travis, C., … Roberts, M. S. (2019). Forecasted Size of Measles Outbreaks Associated With Vaccination Exemptions for Schoolchildren. JAMA Network Open, 2(8), e199768.
Shaw, J., Tserenpuntsag, B., McNutt, L.-A., & Halsey, N. (2014). United States private schools have higher rates of exemptions to school immunization requirements than public schools. The Journal of Pediatrics, 165(1), 129–133.
Tim Appelhans, Florian Detsch, Christoph Reudenbach and Stefan Woellauer (2020). mapview: Interactive Viewing of Spatial Data in R. R package version 2.9.0. https://CRAN.R-project.org/package=mapview
Wickham et al., (2019). Welcome to the tidyverse. Journal of Open Source Software, 4(43), 1686, https://doi.org/10.21105/joss.01686
Yihui Xie (2020). knitr: A General-Purpose Package for Dynamic Report Generation in R. R package version 1.29.
Yihui Xie (2015) Dynamic Documents with R and knitr. 2nd edition. Chapman and Hall/CRC. ISBN 978-1498716963
Yihui Xie (2014) knitr: A Comprehensive Tool for Reproducible Research in R. In Victoria Stodden, Friedrich Leisch and Roger D. Peng, editors, Implementing Reproducible Computational Research. Chapman and Hall/CRC. ISBN 978-1466561595